<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>事项列表</title>
   	<base href="<%=basePath%>">
    <%@ include file="/main/main_css.jsp" %>
    <%@ include file="/main/main_js.jsp" %>
</head>
<body>
    <div class="all-wrapper">
        <div class="row com-header text-center">
            <span>鹰潭市行政服务中心</span>
        </div>
        <div class="row main-content file-upload">
        	<div class="row" >
                <div class="time-count pull-right">
                   <span>剩余</span> <span id="time" class="text-red"></span> <span>秒</span>
                </div>
            </div>
            <div class="row">
                <h1>查询名称：${itemName}</h1>
            </div>
            <c:if test="${itemsList.size()>0 }">
            <c:forEach var="items" items="${itemsList }">
            <div class="row el">
                <div class="col-md-24">
                	<a href="/smartTerminal/getitem?itemId=${items.ITEMID }">
                    	<span class="list-name">${items.ITEMNAME }  </span> 
                    </a>
                   <span class="sm-list-name">办理机构：${items.NORMACCEPTDEPART }</span>
                </div>
            </div>
           </c:forEach>
           </c:if>
            <div class="row">
                <div class="col-md-24">
                    <div class="pull-right">
                    <c:if test="${page.currentpage >1 }">
                    	<button class="btn btn-lg btn-warning" type="button" onclick="nextPage(${page.currentpage-1 });">上一页</button>
                    </c:if>
	                <c:if test="${page.currentpage <=1}">
	                	<button class="btn btn-lg btn-warning" type="button">上一页</button>
	                </c:if>
                    <span class="txt-md">${page.currentpage }/${page.currentRow }</span>
                    <c:if test="${page.currentpage<page.currentRow }">
                    	<button class="btn btn-lg btn-warning" type="button" onclick="nextPage(${page.currentpage+1 });">下一页</button>
                    </c:if>	
                    <c:if test="${page.currentpage>=page.currentRow }">
                    	<button class="btn btn-lg btn-warning" type="button">下一页</button>
                    </c:if>
                    </div>
                </div>
            </div>
        </div>
        <div class="row footer">
            <a class="btn btn-success btn-lg" href="loginOut" role="button"><i class="fa fa-reply"></i>返回首页</a>
        </div>
    </div>
   <form id="itemForm" action="getItemPageforName" method="post">
    	<input type="hidden" id="currentpage" name="currentpage">
    	<input type="hidden" id="pagesize" name="pagesize" value="${page.pageSize}">
    	<input type="hidden" id="itemName" name="itemName" value="${itemName}">
    </form>
    <form id="loginOut" action="loginOut"></form>
</body>
    <script>
  //加入倒计时
	var count =  119;
	function countdown(){
		$("#time").text(count);
		if(count > 0){
			window.setTimeout("countdown()",1000);
			count --;
		}else{
			$("#loginOut").submit();
		}
	}
	countdown();    
    
    	function nextPage(num){
    		$("#currentpage").val(num);
    		$("#itemForm").submit();
    		var index = layer.load(3, {
    		    shade: [0.3,'#000'] //0.1透明度的白色背景  
    			});
    			setTimeout(function(){
    			    layer.close(index);
    		},2000);
    	}
    	
    	var winH = $(document).height();
        var mainH = winH -160;
        $('.main-content').height(mainH);
    </script>
</html>
